<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="tb-master.html" />

<head>
	<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
  	<title></title>
  	${tmpl_context.googlemaps_js()}
  	<py:if test="what == 'addphoto'">
  	${tmpl_context.zeroisp_fileupload()}
  	</py:if>
  	<py:if test="what == 'post'">
  	<script type="text/javascript">
  	jQuery(function() {
    	jQuery('.wymeditor').wymeditor();});
    </script>
    </py:if>

</head>
<body>
	<h2>Editing #${post.id} ${post.post_title} </h2>
	<div py:if="what == 'address'" id="tabs-address" style="padding: 5px;" >
		<span>original address: ${session['address']['google_address']}</span>
			${tb_addressform()}
	</div>
	<div py:if="what == 'post'" >
		${tmpl_context.description_form(value=session['post'])}
	</div>
	<div py:if="what == 'photo'">
		<py:if test="album">
			<div  id="post_photo"  class="ui-corner-all" >
				<table>
					<tr>
						<td>
							<span>Album #${album.gphoto_id.text}</span>
							<!-- ${tmpl_context.album_form(value=dict(title=album.title.text,subtitle=album.subtitle.text, albumid=album.gphoto_id.text))} -->
							<h3>${album.title.text}</h3>
							<blockquote>${album.subtitle.text}</blockquote>

						</td>
						<td >
							<div id="post_photo"  style="margin:auto;" class="ui-corner-all" >

								<h2><a href="${album.link[2].href}" target="_blank">Picasa</a></h2>
								<h2><a href="${album.link[2].href}#slideshow" target="_blank">Slideshow</a></h2>
								<img width="72px" src="${post.post_album.album_thumb}"/>
							</div>
						</td>
					</tr>
				</table>
			</div>
			<div  id="post_photo"  class="ui-corner-all" py:for="photo in album.entry">
				<table>
					<tr>
						<td><img src="${photo.content.src}" /></td>
						<td style="width:100%;">
							<span>Photo #${photo.gphoto_id.text}</span>
							${tmpl_context.photo_form(value=dict(title=photo.title.text,summary=photo.summary.text, albumid=album.gphoto_id.text, photoid=photo.gphoto_id.text))}
						</td>
					</tr>
				</table>

			</div>
		</py:if>
	</div>
	<div py:if="what == 'addphoto'">
	<div id="post_photo"  class="ui-corner-all">
		<table>
			<tr>
				<td>
					<form action="/toolbox/post/add_photos/${post.id}" method="POST" enctype="multipart/form-data" class="P10">

			       		<script type="text/javascript" language="javascript">
										$(function(){ // wait for document to load
			 								$('#T7').MultiFile({
			  									list: '#T7-list'
			 								});
										});
							</script>
			        	<legend><strong>Form Upload Photos</strong></legend>
        				<p>Add photos and click on save</p>
						<input type="file" name="T7" id="T7"/>
						<input type="submit" value="save" />
					</form>
				</td>
				<td>
        			<legend id="google_address_legend">To Upload</legend>
       				<div id="T7-list" ></div>
				</td>
			</tr>
		</table>
	</div>
	<div py:if="album">
		<img py:for="i in album.entry" id="thumbnail" class="ui-corner-all" alt="${i.media.title.text}" src="${i.media.thumbnail[0].url}" />
	</div>
	</div>
</body>
</html>
